package com.atguigu.tingshu.user.client;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.user.client.impl.UserInfoDegradeFeignClient;
import com.atguigu.tingshu.vo.user.UserInfoVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 产品列表API接口
 * </p>
 *
 *
 */
@FeignClient(value = "service-user", fallback = UserInfoDegradeFeignClient.class)
public interface UserInfoFeignClient {

    /**
     * 根据用户id查询用户信息
     * @param userId
     * @return
     */
    @GetMapping("api/user/userInfo/getUserInfoVo/{userId}")
    public Result<UserInfoVo> getUserInfoVoByUserId(@PathVariable Long userId);


    /**
     * 获取用户付费的音频
     * @param albumId
     * @param trackIdList
     * @return
     */

    @PostMapping("api/user/userInfo/userIsPaidTrack/{albumId}")
    public Result<Map<Long, Integer>> getPaiedTrack(@PathVariable Long albumId,@RequestBody List<Long> trackIdList);

    /**
     * 判断用户是否购买过专辑
     * @param albumId
     * @return
     */
    @GetMapping("api/user/userInfo/isPaidAlbum/{albumId}")
    Result<Boolean> isPaidAlbum(@PathVariable("albumId") Long albumId);
}